import React from 'react';
import ItemSelectionModal from './ItemSelectionModal';
import type { SelectionItem } from './ItemSelectionModal';

export interface KnowledgeBaseSelectModalProps {
  title?: string;
  visible: boolean;
  selectedIds?: string[];
  knowledgeBases: SelectionItem[];
  searchPlaceholder?: string;
  confirmText?: string;
  cancelText?: string;
  onCancel: () => void;
  onConfirm: (selectedItems: SelectionItem[]) => void;
}

const KnowledgeBaseSelectModal: React.FC<KnowledgeBaseSelectModalProps> = ({
  title = "选择知识库",
  visible,
  selectedIds = [],
  knowledgeBases,
  searchPlaceholder = "搜索知识库",
  confirmText = "确定",
  cancelText = "取消",
  onCancel,
  onConfirm
}) => {
  return (
    <ItemSelectionModal
      title={title}
      visible={visible}
      dataSource={knowledgeBases}
      selectedIds={selectedIds}
      treeMode={false}
      searchPlaceholder={searchPlaceholder}
      confirmText={confirmText}
      cancelText={cancelText}
      onCancel={onCancel}
      onConfirm={onConfirm}
    />
  );
};

export default KnowledgeBaseSelectModal; 